LassoScript Utility
Basics Browse Detail

[Image->Composite]

Tag Link [Image->Composite] Category Image
Type Member Source Available Yes
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

Composites a second image onto the current image. Requires a second Lasso image variable to be composited.

Syntax

[Image Variable->(Composite: Image Variable #2, -Op='Composite Operator', -Left=Integer, -Top=Integer)]

Parameters

Optional Parameters
-Op Specifies the composite method which affects how the second image is applied to the first image (a list of operators is shown below).

  • Over – The result is the union of the the two image shapes with the composite image obscuring the image in the region of overlap.

  • In – The result is the first image cut by the shape of the second image. None of the second image data is included in the result.

  • Out – The result is the second image cut by the shape of the first image. None of the first image data is included in the result.

  • Plus – The result is the sum of the raw image data where the color-level extremes are limited by the maximum values available in each image.

  • Minus – The result is the subtraction of the raw image data where the color-level extremes are limited by the minimum values available in each image.

  • Add – The result is the sum of the raw image data without color-level limitations.

  • Subtract – The result is the subtraction of the raw image data without color-level limitations.

  • Difference – Returns the difference between two images. This is useful for comparing two very similar images.

  • Bumpmap – The resulting image is shaded by the second image.

  • CopyRed – The resulting image is the red layer in the image replaced with the red layer in the second image.

  • CopyGreen – The resulting image is the green layer in the image replaced with the green layer in the second image.

  • CopyBlue – The resulting image is the blue layer in the image replaced with the blue layer in the second image.

  • CopyOpacity – The resulting image is the opaque layer in the image replaced with the opaque layer in the second image.

  • Displace – Displaces part of the first image where the second image is overlaid.

  • Threshold – Only colors in the second image that are darker than the colors in the first image are overlaid.

  • Darken – Only dark colors in the second image are overlaid.

  • Lighten – Only light colors in the second image are overlaid.

  • Colorize – Only base spectrum colors in the second image are overlaid.

  • Hue – Only the hue of the second image is overlaid.

  • Saturate – Only the saturation of the second image is overlaid.

  • Luminize – Only the luminousity of the the second image is overlaid.

  • Modulate – Has the effect of Hue, Saturate, and Luminize functions applied at the same time.
  • -Left Specifies the offset of the second image from the left side of the first image in integer pixels.
    -Top Specifies the offset of the second image from the top of the first image in integer pixels.
    -Opacity Specifies the opacity of the composited second image, where 0 is fully opaque and 1.0 is fully transparent.

    Examples

    To overlay an image on top of another image:

    Use the [Image->Composite] tag to add a defined image variable to a second defined image variable. The following example adds image2.jpg offset by five pixels in the upper left corner of image1.jpg.

    [Var: 'MyImage1' =(Image: '/images/image1.jpg')]
    [Var: 'MyImage2' =(Image: '/images/image2.jpg')]
    [$MyImage1->(Composite: $MyImage2, -Left=5, -Top=5)]
    [$MyImage1->(Save: '/images/image1.jpg')]

    To add a watermark to an image:

    Use the [Image->Composite] tag with the -Opacity parameter to add a defined image variable to a second defined image variable. The following example adds a mostly transparent version of image2.jpg to image1.jpg.

    [Var: 'MyImage1' =(Image: '/images/image1.jpg')]
    [Var: 'MyImage2' =(Image: '/images/image2.jpg')]
    [$MyImage1->(Composite: $MyImage2, -Opacity=0.75)]
    [$MyImage1->(Save: '/images/image1.jpg')]

    To shade image with a second image:

    Use the [Image->Composite] tag with the Bumpmap operator to shade a defined image variable over a second defined image variable.

    [Var: 'MyImage1' =(Image: '/images/image1.jpg')]
    [Var: 'MyImage2' =(Image: '/images/image2.jpg')]
    [$MyImage1->(Composite: $MyImage2, -Op='Bumpmap')]
    [$MyImage1->(Save: '/images/image1.jpg')]

    To return the pixel difference between two images:

    Use the [Image->Composite] tag with the Difference operator to return the pixel difference between two defined image variables.

    [Var: 'MyImage1' =(Image: '/images/image1.jpg')]
    [Var: 'MyImage2' =(Image: '/images/image2.jpg')]
    [$MyImage1->(Composite: $MyImage2, -Op='Difference')]
    [$MyImage1->(Save: '/images/image1.jpg')]